<?php

namespace app\admin\controller;
use app\base\controller\Base;
use think\Request;
use think\Cache;
use think\Config;
use think\Session;

//日志
class Payfor extends Base
{
    public  $model;

    public function __construct()
    {

        parent::__construct();
    }

    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function save()
    {//
        $arr = ['deposit',"CertName","CertNo","Phone","bank_no","bank_general_name","bank_name"];
        //'deposit'=>"代付金额","CertName"=>"姓名',"CertNo"=》身份证号,"Phone"=》电话号码,"bank_no"=》银行卡号,"bank_general_name"=》银行名称,"bank_name"=》银行名称

        $result =getConfigByZhifu();
        $payNo = ordersn();
        //中南支付
        if($result['id']==59){
            $a  = new \pay\Znan();

            $from =  $a->daiPay($this->deposit,$payNo,$this->bank_no,$this->CertName,$this->bank_general_name,$this->bank_name,$this->Phone,$this->CertNo);
            if(!empty($from)){
                return sucessJson("成功",['url'=>$from]);
            }

        }


        if($result['id']==58){
            $pay = new \pay\Tlian();
            /**
             *  天联支付
             */
            $from =  $pay->daiPay($this->deposit,$payNo,$this->CertName,$this->bank_no);
            if(!empty($from)){
                return sucessJson("成功",['url'=>$from]);
            }

        }

        return failJson("失败");

    }





}
